<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <button onclick="JZ()">加载</button>

    <script>
        function JZ() {
            //兼容浏览器
            let xmlhttp ;
            if( window.XMLHttpRequest){
                console.log("IE7以上版本");
                xmlhttp = new XMLHttpRequest
            }else{
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
                console.log("IE6以下版本");
            }

            xmlhttp.onloadstatechange = () => {
                if( xmlhttp.readyState == 4 && xmlhttp.status == 200 ){
                    document.getElementById("app").innerHTML = xmlhttp.responseText
                }
            }

            xmlhttp.open("GET","http://127.0.0.1:1337/",true)
            xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
            xmlhttp.send()
        }
    </script>
</body>
</html>